﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UtcTimeTest;

namespace ZZZ_StartProject
{
    class Program
    {
        static void Main(string[] args)
        {
            while(true)
            {
                Console.WriteLine("> Input Minutes beforeNow:");
                string inputstr = Console.ReadLine();
                if (inputstr.ToLower() == "s") return;
                int minutebefore = int.Parse(inputstr);
                OutputEpoch(minutebefore);
            }
            
            
            
        }

        static void OutputEpoch(int minuteBefore)
        {
            DateTime utcNow = DateTime.UtcNow;
            DateTime dtoutput = utcNow.AddMinutes(minuteBefore);
            string result = EpochTest.GetEpoch19700101UTC(dtoutput);
            string utcOutput = EpochTest.GetEpoch19700101UTC(utcNow);
            Console.WriteLine(string.Format("> DateTime=\t{0}\tKind={1}, Epoch={2}", dtoutput.ToString("yyyy/MM/dd HH:mm:ss"), dtoutput.Kind, result));
            Console.WriteLine(string.Format("> DtNow=\t{0}\tKind={1}, Epoch={2}", utcNow.ToString("yyyy/MM/dd HH:mm:ss"), utcNow.Kind, utcOutput));
        }
    }
}
